package com.aoip.telemetry.telemetry.quartz;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author chenbai
 * @version 1.0
 * @Description TODO
 * @date 2022/4/26 21:29
 */
public class test {

    private static void test1() throws ScriptException {
        String str = "F0F0*(2 + 1.4)+2*32/(3-2)";
        ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngine engine = manager.getEngineByName("js");
        Object result = engine.eval(str);
        System.out.println("结果类型:" + result.getClass().getName() + ",计算结果:" + result);
    }

    public static void main(String[] args) throws ScriptException {
        test1();
        double m=4.0;
        double n=Math.sqrt(m);
        System.out.println(n);
//        AtomicInteger
    }
}
